#include <iostream>
#include <algorithm>
#include <cstdio>
#include <array>
#include <queue>
#include <bitset>
#include <map>
#define int long long
#define pii pair <int, int>
using namespace std;
#ifdef ONLINE_JUDGE

#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
char buf[1 << 23], *p1 = buf, *p2 = buf, ubuf[1 << 23], *u = ubuf;

#endif
int read() {
	int p = 0, flg = 1;
	char c = getchar();
	while (c < '0' || c > '9') {
		if (c == '-') flg = -1;
		c = getchar();
	}
	while (c >= '0' && c <= '9') {
		p = p * 10 + c - '0';
		c = getchar();
	}
	return p * flg;
}
void write(int x) {
	if (x < 0) {
		x = -x;
		putchar('-');
	}
	if (x > 9) {
		write(x / 10);
	}
	putchar(x % 10 + '0');
}
bool _stmer;

#define fi first
#define se second

const int N = 2e7 + 5, M = 1e5 + 5, K = 125, mod = 998244353;

int pow_(int x, int k, int p) {
	int ans = 1;
	while (k) {
		if (k & 1) ans = ans * x % p;
		x = x * x % p;
		k >>= 1;
	}
	return ans;
}

array <int, 5> idx;

map <array <int, 5>, int> mp;
array <array <int, 5>, M> _mp;

void upd(int &x, int y) {
	x += y;
	if (x >= mod) x -= mod;
	if (x < 0) x += mod;
}

array <array <int, M>, K> f;
array <bitset <M>, K> vis;

void bfs(int n, int m) {
	queue <pii> q;
	q.push(make_pair(1, 0));
	f[1][0] = 1;
	//int tp0 = pow_(n, mod - 2, mod);
	while (!q.empty()) {
		pii u = q.front(); q.pop();
		if (u.fi == 1 && u.se == m) break;
		if (vis[u.fi][u.se]) continue;
		vis[u.fi][u.se] = 1;
		array <int, 5> res = _mp[u.fi], now; now.fill(0);
		for (int i = 0; i < n; i++) {
			for (int j = 1; j < i + 1; j++) now[j - 1] = res[j];
			for (int j = i + 1; j < n; j++) now[j] = res[j];
			now[i] = res[0];
			upd(f[mp[now]][u.se + 1], f[u.fi][u.se]);
			q.push(make_pair(mp[now], u.se + 1));
		}
	}
}

bool _edmer;
signed main() {
	cerr << (&_stmer - &_edmer) / 1024.0 / 1024.0 << "MB\n";
#ifndef cxqghzj
	freopen("drama.in", "r", stdin);
	freopen("drama.out", "w", stdout);
#endif
	int n = read(), m = read(), tot = 0;
	for (int i = 0; i < n; i++) idx[i] = i;
	do {
		tot++;
		mp[idx] = tot;
		_mp[tot] = idx;
	} while (next_permutation(idx.begin(), idx.begin() + n));
	bfs(n, m);
	write(f[1][m]), puts("");
	return 0;
}
